<?php
$param_type = array(
	'name'	=> 'param_type',
	'id'	=> 'param_type',
	'value' => set_value('param_type'),
	'size' 	=> 30,
);

$title_color = array(
	'name'	=> 'title_color',
	'id'	=> 'title_color',
	'value' => set_value('title_color'),
	'size' 	=> 6,
);

$desc_color = array(
	'name'	=> 'desc_color',
	'id'	=> 'desc_color',
	'value' => set_value('desc_color'),
	'size' 	=> 6,
);

$url_color = array(
	'name'	=> 'url_color',
	'id'	=> 'url_color',
	'value' => set_value('url_color'),
	'size' 	=> 6,
);

$container_w = array(
	'name'	=> 'container_w',
	'id'	=> 'container_w',
	'value' => set_value('container_w'),
	'size' 	=> 10,
);

$container_h = array(
	'name'	=> 'container_h',
	'id'	=> 'container_h',
	'value' => set_value('container_h'),
	'size' 	=> 10,
);

$container_border_c = array(
	'name'	=> 'container_border_c',
	'id'	=> 'container_border_c',
	'value' => set_value('container_border_c'),
	'size' 	=> 6,
);

$container_background_c = array(
	'name'	=> 'container_background_c',
	'id'	=> 'container_background_c',
	'value' => set_value('container_background_c'),
	'size' 	=> 6,
);

$ysmlabel_color = array(
	'name'	=> 'ysmlabel_color',
	'id'	=> 'ysmlabel_color',
	'value' => set_value('ysmlabel_color'),
	'size' 	=> 6,
);

$title_fontsize = array(
	'name'	=> 'title_fontsize',
	'id'	=> 'title_fontsize',
	'value' => set_value('title_fontsize'),
	'size' 	=> 6,
);

$desc_fontsize = array(
	'name'	=> 'desc_fontsize',
	'id'	=> 'desc_fontsize',
	'value' => set_value('desc_fontsize'),
	'size' 	=> 6,
);

$url_fontsize = array(
	'name'	=> 'url_fontsize',
	'id'	=> 'url_fontsize',
	'value' => set_value('url_fontsize'),
	'size' 	=> 6,
);

$css = array(
	'name'	=> 'css',
	'id'	=> 'css',
	'value' => 'default',
	'size' 	=> 10,
	'style'=>'display:none;'
);
//$this->lang->load('form_validation','chinese');
?>

<?php 
/*
$this->ci =& get_instance();
$this->ci->load->library('session');
$this->ci->load->model('tank_auth/users');

$logined_user = $this->ci->session->all_userdata();
$user_data = $this->ci->users->get_user_by_id($logined_user['user_id'],true);

echo $user_data->role;
//echo $this->ci->session->userdata('user_id');
*/
?>
<?php //echo validation_errors(); ?>
<?php echo form_open('ads/initial_ads'); ?>
<table>
	<tr>
		<td><?php echo form_label('版位名稱', $param_type['id']); ?></td>
		<td><?php echo form_input($param_type); ?></td>
		<td style="color: red;"><?php echo form_error($param_type['name']); ?><?php echo isset($errors[$param_type['name']])?$errors[$param_type['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('廣告標題顏色', $title_color['id']); ?></td>
		<td><?php echo form_input($title_color); ?></td>
		<td style="color: red;"><?php echo form_error($title_color['name']); ?><?php echo isset($errors[$title_color['name']])?$errors[$title_color['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('廣告描述顏色', $desc_color['id']); ?></td>
		<td><?php echo form_input($desc_color); ?></td>
		<td style="color: red;"><?php echo form_error($desc_color['name']); ?><?php echo isset($errors[$desc_color['name']])?$errors[$desc_color['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('廣告網址顏色', $url_color['id']); ?></td>
		<td><?php echo form_input($url_color); ?></td>
		<td style="color: red;"><?php echo form_error($url_color['name']); ?><?php echo isset($errors[$url_color['name']])?$errors[$url_color['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('版位寬度', $container_w['id']); ?></td>
		<td><?php echo form_input($container_w); ?></td>
		<td style="color: red;"><?php echo form_error($container_w['name']); ?><?php echo isset($errors[$container_w['name']])?$errors[$container_w['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('版位高度', $container_h['id']); ?></td>
		<td><?php echo form_input($container_h); ?></td>
		<td style="color: red;"><?php echo form_error($container_h['name']); ?><?php echo isset($errors[$container_h['name']])?$errors[$container_h['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('版位邊框顏色', $container_border_c['id']); ?></td>
		<td><?php echo form_input($container_border_c); ?></td>
		<td style="color: red;"><?php echo form_error($container_border_c['name']); ?><?php echo isset($errors[$container_border_c['name']])?$errors[$container_border_c['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('版位背景顏色', $container_background_c['id']); ?></td>
		<td><?php echo form_input($container_background_c); ?></td>
		<td style="color: red;"><?php echo form_error($container_background_c['name']); ?><?php echo isset($errors[$container_background_c['name']])?$errors[$container_background_c['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('標題字體大小', $title_fontsize['id']); ?></td>
		<td><?php echo form_input($title_fontsize); ?></td>
		<td style="color: red;"><?php echo form_error($title_fontsize['name']); ?><?php echo isset($errors[$title_fontsize['name']])?$errors[$title_fontsize['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('描述字體大小', $desc_fontsize['id']); ?></td>
		<td><?php echo form_input($desc_fontsize); ?></td>
		<td style="color: red;"><?php echo form_error($desc_fontsize['name']); ?><?php echo isset($errors[$desc_fontsize['name']])?$errors[$desc_fontsize['name']]:''; ?></td>
	</tr>
	<tr>
		<td><?php echo form_label('網址字體大小', $url_fontsize['id']); ?></td>
		<td><?php echo form_input($url_fontsize); ?></td>
		<td style="color: red;"><?php echo form_error($url_fontsize['name']); ?><?php echo isset($errors[$url_fontsize['name']])?$errors[$url_fontsize['name']]:''; ?></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><?php echo form_input($css); ?></td>
		<td style="color: red;"><?php echo form_error($css['name']); ?><?php echo isset($errors[$css['name']])?$errors[$css['name']]:''; ?></td>
	</tr>
</table>
<?php echo form_submit('generate', 'Generate Ads'); ?>
<?php echo form_close(); ?>